{extends file="index.tpl"} 
{block name="page-content"}
{literal}
<script type="text/javascript">
$(document).ready(function() {
	$('input[name="mediumName"]').blur(function() {
		var mediumName=$('input[name="mediumName"]').val();
		$.ajax({
			type: "GET",
			url: "http://localhost/istargame-admin/controller/process/ajaxCheckMediumName.php?mediumName="+mediumName,
			data: { mediumName: mediumName }
		}).done(function(res) {
			if (res == 1){
				$('#mediumName').css({"border-color": "red"});
			} else {
				$('#mediumName').css({"border-color": "#CCC"});
			}
		});                   
	});
});          
</script>
{/literal}
<div class="row-fluid">
		<div class="span12">
			<div class="block">
				<div class="head">
					<h2>Thêm App</h2>
					<ul class="buttons">
						<li>
							<a href="#" onClick="source('form_validation'); return false;">
								<div class="icon"><span class="ico-info"></span></div>
							</a>
						</li>
					</ul>
				</div>
				<form id="validate" method="POST" action="{$WEB_BASE_URL}/index.php?controller=app&action=add">
					<div class="data-fluid">
						<div class="row-form">
							<div class="span2">Type App</div>
							<div class="span10">
								<select name="type" class="select" style="width: 100%;">
									<option value="1">Ứng Dụng</option>
									<option value="2">Tử vi</option>
								</select>
							</div>
						</div>
						
						<div class="row-form">
							<div class="span2">Name</div>
							<div class="span10">
								<input type="text" class="validate[required]" name="name" /> 
								<span class="bottom">Required</span>
							</div>
						</div>
						<div class="row-form">
							<div class="span2">Medium Name</div>
							<div class="span10">
								<input type="text" class="" name="mediumName" id="mediumName"/> 
								<span class="bottom">Required</span>
							</div>
						</div>  
						<div class="row-form">
							<div class="span2">SEO Name</div>
							<div class="span10">
								<input type="text" name="SEO_Name"/>
							</div>
						</div>
						<div class="row-form">
							<div class="span2">Image</div>
							<div class="span10">
								<input type="text" class="validate[required]" name="image" /> 
								<span class="bottom">Required</span>
							</div>
						</div>
						<div class="row-form">
							<div class="span2">Sort Detail</div>
							<div class="span10"><textarea name="shortDetail" placeholder="Placeholder example" class="validate[required]"></textarea></div>
						</div>
						<div class="row-form">
							<div class="span2">Medium Detail</div>
							<div class="span10"><textarea name="mediumDetail" placeholder="Placeholder example" class="validate[required]"></textarea></div>
						</div>
						<div class="block">
	                        <div class="head green">                                
	                            <h2>Long Detail</h2>               
	                        </div>
	                        <textarea id="elrte" name="longDetail" cols="auto" rows="auto" style="height:500px !important;"></textarea>
	                    </div>    
						<div class="row-form">
							<div class="span2">Parent</div>
							<div class="span3">
                             	<input type="radio" class="validate[required]" checked="checked" name="parent" value="8"/>Ứng Dụng
                             	<input type="radio" class="validate[required]" name="parent" value="7"/>Tử Vi
                          	</div>
						</div>
						<div class="row-form">
							<div class="span2">SEO_title</div>
							<div class="span10"><textarea name="SEO_title" placeholder="Placeholder example"></textarea></div>
						</div>
						<div class="row-form">
							<div class="span2">SEO_metaDescription</div>
							<div class="span10"><textarea name="SEO_metaDescription" placeholder="Placeholder example" class="validate[required]"></textarea></div>
						</div>
						<div class="row-form">
							<div class="span2">SEO_keyword</div>
							<div class="span10"><textarea name="SEO_keyword" placeholder="Placeholder example" class="validate[required]"></textarea></div>
						</div>
						<div class="row-form">
							<div class="span2">Link MWork</div>
							<div class="span10">
								<input type="text" name="linkMWork" /> 
								<span class="bottom">Only Tử Vi</span>
							</div>
						</div>
						<div class="toolbar bottom tar">
							<div class="btn-group">
								<button class="btn btn-info" type="button" onClick="$('#validate').validationEngine('hide');">Hide prompts</button>
                                <button class="btn" type="submit">Add App</button>
                            </div>
                       	</div>
					</div>
					
				</form>
			</div>
		</div>
	
	</div>

{/block}

